﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Register.Command;
using Register.DALFactory;
using Register.IDAL;
using Register.Model;
namespace Register.BLL
{
    /// <summary> 
    /// FileName: CheckLoginBLL.cs    
    /// CLRVersion: 4.0.30319.269    
    /// Author: DoubleZ    
    /// Corporation:     
    /// Description:     
    /// DateTime: 2012/7/17 17:00:02    
    /// </summary>
   public class CheckLoginBLL
    {
       private static  string typeNameKey = "ICheckLoginDALKey";
       #region 检查管理员用户是否已经存在
       public static bool ExistsAdmin(string name, string pwd)
       {
           ICheckLoginDAL iAdmin = DALFactory<ICheckLoginDAL>.Create(typeNameKey);

           try
           {
               return iAdmin.ExistsAdmin(name,pwd);
           }
           catch (Exception e)
           {
               LogRecordHelper.LogNote("ERROR", e.Message);
               throw e;
           }
       }

       #endregion
       #region 检查医生用户是否已经存在
       public static bool ExistsDoctor(string name, string pwd)
       {
           ICheckLoginDAL iDoctorUserInfo = DALFactory<ICheckLoginDAL>.Create(typeNameKey);

           try
           {
               return iDoctorUserInfo.ExistsDoctor(name,pwd);
           }
           catch (Exception e)
           {
               LogRecordHelper.LogNote("ERROR", e.Message);
               throw e;
           }
       }

       #endregion
    }
}
